package cn.ds.fly.modules.sys.controller;

import cn.ds.fly.common.BaseController;
import cn.ds.fly.modules.sys.entity.FlyMenu;
import cn.ds.fly.modules.sys.service.MenuService;
import cn.ds.fly.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by lds on 2017/12/15.
 * @author lds
 */
@RestController
@RequestMapping("/sys/menu")
public class MenuController extends BaseController {

    @Autowired
    private MenuService menuService;

    @GetMapping("/nav")
    public R nav(){
        List<FlyMenu> userMenuList = menuService.getUserMenuList(getUserId());
        return R.ok().put("menuList",userMenuList);
    }
}
